class SweetPotato:

    def __init__(self):
        self.cookedString = "生的"
        self.cookedlevel = 0
        self.condiments = []

    def __str__(self):
        return "地瓜 状态:%s(%d),添加的佐料有：%s" % (self.cookedString, self.cookedlevel, str(self.condiments))

    def cook(self, cooked_time):

        self.cookedlevel += cooked_time

        if self.cookedlevel > 0 and self.cookedlevel < 3:
            self.cookedString = "生的"
        elif self.cookedlevel >= 3 and self.cookedlevel < 5:
            self.cookedString = "半生不熟"
        elif self.cookedlevel >= 5 and self.cookedlevel < 8:
            self.cookedString = "熟了"
        elif self.cookedlevel >= 8:
            self.cookedString = "烤糊了"

    def addCondinments(self, item):
        self.condiments.append(item)


# 创建了一个地瓜对象
di_gua = SweetPotato()

# 开始烤地瓜
di_gua.cook(1)
print(di_gua)
di_gua.cook(1)
print(di_gua)
di_gua.addCondinments("大蒜")
di_gua.cook(1)
print(di_gua)
di_gua.cook(1)
print(di_gua)
di_gua.addCondinments("番茄酱")
di_gua.cook(1)
print(di_gua)
di_gua.addCondinments("孜然")
di_gua.cook(1)
print(di_gua)
di_gua.addCondinments("芥末")
print(di_gua)
